home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
TCL1
/
CNUMBERE
/
CTESTPAN.C
< prev
next >
Wrap
Text File
|
1991-07-04
|
2KB
|
72 lines
/* Methods for CTestPane */
#include "CTestPane.h"
#define DOUBLENUM1COMMAND 5430
#define DOUBLENUM2COMMAND 5431
#define LONGNUMCOMMAND 5432
#define STRINGCOMMAND 5433
void CTestPane::IStarterPane(CView *anEnclosure, CBureaucrat *aSupervisor,
short aWidth, short aHeight,
short aHEncl, short aVEncl,
SizingOption aHSizing, SizingOption aVSizing)
{
Rect aRect;
inherited::IStarterPane(anEnclosure, aSupervisor, aWidth, aHeight,
aHEncl, aVEncl, aHSizing, aVSizing);
wantsClicks=TRUE;
doubleNum1=23.234001e-12;
doubleNum2=-6.059e4054;
longNum=342234L;
CopyPString((StringPtr)"\p a string", itsString);
SetRect(&aRect, 10, 40, 370, 100);
doubleNum2Editor=new(CNumberEditor);
doubleNum2Editor->INumberEditor(this, this, (StringPtr)"\pNewYork", 0, &aRect,
2, DOUBLENUM2COMMAND);
doubleNum2Editor->SetDoubleValue(doubleNum2);
SetRect(&aRect, 10, 130, 200, 160);
longNumEditor=new(CNumberEditor);
longNumEditor->INumberEditor(this, this, (StringPtr)"\pChicago", 0, &aRect,
0, LONGNUMCOMMAND);
longNumEditor->SetLongValue(longNum);
SetRect(&aRect, 10, 10, 140, 25);
doubleNum1Editor=new(CNumberEditor);
doubleNum1Editor->INumberEditor(this, this, (StringPtr) "\pTimes", 12, &aRect,
12, DOUBLENUM1COMMAND);
doubleNum1Editor->SetDoubleValue(doubleNum1);
SetRect(&aRect, 10, 180, 250, 210);
stringEditor=new(CNumberEditor);
stringEditor->INumberEditor(this, this, (StringPtr) "\pNewYork", 0, &aRect,
-1, STRINGCOMMAND);
stringEditor->SetString(itsString);
}
void CTestPane::DoCommand(long theCommand)
{
switch(theCommand)
{
case DOUBLENUM1COMMAND: doubleNum1=doubleNum1Editor->GetDoubleValue();
break;
case DOUBLENUM2COMMAND: doubleNum2=doubleNum2Editor->GetDoubleValue();
break;
case LONGNUMCOMMAND: longNum=longNumEditor->GetLongValue();
break;
case STRINGCOMMAND: stringEditor->GetString(itsString);
break;
default: inherited::DoCommand(theCommand);
}
}